package com.beaven.model.data.user;

import com.beaven.model.data.BaseDbRepository;
import com.beaven.model.data.DbDataSource;
import com.beaven.model.model.db.User;
import com.beaven.model.model.db.User_Table;
import com.beaven.model.model.sp.Account;
import com.raizlabs.android.dbflow.sql.language.SQLite;
import java.util.List;

/**
 * author: Beaven
 * time: 2017/5/26 16:04
 */

public class ContactRepository extends BaseDbRepository<User> implements DbDataSource<User> {

  @Override public void load(SuccessCallBack<List<User>> callBack) {
    super.load(callBack);
    // 加载本地数据库数据
    SQLite.select()
        .from(User.class)
        .where(User_Table.isFollow.eq(true))
        .and(User_Table.id.notEq(Account.getUserId()))
        .async()
        .queryListResultCallback(this)
        .execute();
  }
}
